import React, { Component } from 'react'
import { Switch, Route, Redirect, BrowserRouter } from 'react-router-dom'

import Search from '../pages/search'
import Order from '../pages/order'

import login from "@/pages/login/login"
import profile from "@/pages/profile/profile"
import info from "@/pages/info/info"
import setUser from "@/pages/set_user/set_user"
import msite from "@/pages/msite/msite"
import shop from "@/pages/shop/shop"
import food from "@/pages/food/food"

export default class RouteConfig extends Component {
  render() {
    return (
      <BrowserRouter>
        <Switch>
          <Route path="/profile" exact component={profile} />
          <Route path="/login" component={login} />
          <Route path="/info" component={info} />
          <Route path="/msite" component={msite} />
          <Route path="/setuser" component={setUser} />
          <Route path="/shop/:id" component={shop} />
          <Route path="/food/:geohash/:id/:title" component={food} />
          <Route path="/order" component={Order} />
          <Route path="/search" component={Search} />
          <Redirect exact from='/' to='/profile' />
          <Redirect exact from='/profile/*' to='/profile' />
        </Switch>
      </BrowserRouter>
    )
  }
}